# coding=utf-8
import os

from crontab import CronTab


def create_cron(cron):
    """
    Check crontab values using https://crontab.guru
    """
    # cron.new(command='/bin/bash /astock/stk/bb.sh').setall('* * * * *')
    cron.new(command='/bin/bash /astock/stk/a_reboot.sh').setall('10 15 * * 1,2,3,4,5')
    cron.new(command='/bin/bash /astock/stk/aa.sh').setall('30 16 * * 1,2,3,4,5')
    cron.write()


if __name__ == '__main__':
    os.system('crontab -r')
    cron_tab = CronTab(user=True)
    create_cron(cron_tab)
    os.system('sudo service cron restart')
